#include <stdio.h>

int main()
{
    int a,b,c,mod;
    char d,shibie;
    int n1,n2,n3,n4,n5,n6,n7,n8,n9;
    scanf("%d-%d-%d-%c",&a,&b,&c,&d);
    n1=a;
    n2=b/100;
    n3=(b%100)/10;
    n4=b%10;
    n5=c/10000;
    n6=(c%10000)/1000;
    n7=(c%1000)/100;
    n8=(c%100)/10;
    n9=c%10;
    //printf("%d %d %d %d %d %d %d %d %d\n\n",n1,n2,n3,n4,n5,n6,n7,n8,n9);
    mod=(n1+n2*2+n3*3+n4*4+n5*5+n6*6+n7*7+n8*8+n9*9)%11;
    if(mod==10)
        shibie='X';

    if(((d-48)==mod) || (d=='X' && mod==10))
    //'0'的ASCII=48,所以字符'1'转化为整形数字1，即'1'-'0'=1 相当于49-48=1.
        printf("Right");
    else if(mod!=10 && (d-48)!=mod)
        printf("%d-%d-%d-%c",a,b,c,(mod+48));
    else if(mod==10 && (d-48)!=mod)
        printf("%d-%d-%d-X",a,b,c);

    return 0;
}